package org.nuonuo.sdk.model.res;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.nuonuo.sdk.constant.InvoiceConstant;
import org.nuonuo.sdk.model.base.*;

import java.util.List;

/**
 * @Version 1.0
 * @Author az
 * @Date 2024-04-09 13:40:33
 * @ClassName InvoiceRes
 * @Description 开票结果
 */
public class InvoiceRes extends NN<List<InvoiceRes>> {

    /**
     * 发票请求流水号
     */
    private String serialNo;
    /**
     * 订单编号
     */
    private String orderNo;
    /**
     * <pre>
     * 发票状态：
     *  2: 开票完成（ 最终状态）
     *  20: 开票中
     *  21: 开票成功签章中
     *  22: 开票失败
     *  24: 开票成功签章失败
     *  3: 发票已作废
     *  31: 发票作废中 备注：22、24状态时，无需再查询，请确认开票失败原因以及签章失败原因； 注：请以该状态码区分发票状态
     * </pre>
     */
    private String status;
    /**
     * 发票状态描述
     */
    private String statusMsg;
    /**
     * 失败原因
     */
    private String failCause;
    /**
     * 发票pdf地址（若同时返回了ofdUrl与pdfUrl，则pdf文件不能做为原始凭证，请用ofd文件做为原始凭证） </bre>
     * 示例：https://inv.jss.com.cn/group1/M00/A6/4C/wKgHPll_IU-AVELfAACNq5bmzFM769.pdf
     */
    private String pdfUrl;
    /**
     * 发票图片地址
     */
    private String pictureUrl;
    /**
     * 开票时间
     */
    private Long invoiceTime;
    /**
     * 发票代码（数电票时为空，数电票时有值）
     */
    private String invoiceCode;
    /**
     * 发票号码（数电票时返回原来的20位数电票号码，数电纸票时为8位的纸票号码）
     */
    private String invoiceNo;
    /**
     * allElectronicInvoiceNumber 数电票号码（数电电票、数电纸票时均返回20位数电票号码）
     */
    private String allElectronicInvoiceNumbe;
    /**
     * 不含税金额
     */
    private String exTaxAmount;
    /**
     * 合计税额
     */
    private String taxAmount;
    /**
     * 价税合计
     */
    private String orderAmount;
    /**
     * 购方名称（付款方名称）
     */
    private String payerName;
    /**
     * 购方税号（付款方税号）
     */
    private String payerTaxNo;
    /**
     * 购方地址
     */
    private String address;
    /**
     * 购方电话
     */
    private String telephone;
    /**
     * 购方银行开户行及账号<br/>
     * 示例：杭州农业银行13766103980009876
     */
    private String bankAccount;
    /**
     * 发票种类，包含：增值税电子普通发票、增值税普通发票、专用发票(电子)、增值税专用发票、收购发票(电子)、收购发票(纸质)、增值税普通发票(卷式)、机动车销售统一发票、二手车销售统一发票、电子发票(增值税专用发票)、电子发票(普通发票)、全电纸质发票(增值税专用发票)、全电纸质发
     */
    private String invoiceKind;
    /**
     * 校验码（数电票时为空）
     */
    private String checkCode;
    /**
     * 二维码
     */
    private String qrCode;
    /**
     * 税控设备号（机器编码）；数电票时为空
     */
    private String machineCode;
    /**
     * 发票密文（数电票时为空）
     */
    private String cipherText;
    /**
     * 含底图纸票pdf地址
     */
    private String paperPdfUrl;
    /**
     * 发票ofd地址（公共服务平台签章时返回）
     */
    private String ofdUrl;
    /**
     * 发票xml地址（数电电票且企业配置成支持获取xml时返回）
     */
    private String xmlUrl;
    /**
     * 开票员
     */
    private String clerk;
    /**
     * 收款人
     */
    private String payee;
    /**
     * 复核人
     */
    private String checker;
    /**
     * 销方银行账号
     */
    private String salerAccount;
    /**
     * 销方电话
     */
    private String salerTel;
    /**
     * 销方地址
     */
    private String salerAddress;
    /**
     * 销方税号
     */
    private String salerTaxNum;
    /**
     * 销方名称
     */
    @JsonProperty("saleName")
    private String salerName;
    /**
     * 备注
     */
    private String remark;
    /**
     * 成品油标志：0非成品油，1成品油
     */
    private String productOilFlag;
    /**
     * 图片地址（多个图片以逗号隔开）
     */
    private String imgUrls;
    /**
     * 分机号
     */
    private String extensionNumber;
    /**
     * 终端号
     */
    private String terminalNumber;
    /**
     * 部门门店id（诺诺系统中的id）
     */
    private String deptId;
    /**
     * 开票员id（诺诺系统中的id）
     */
    private String clerkId;
    /**
     * 对应蓝票发票代码，红票时有值（蓝票为数电电票时为空，数电纸票时有值）
     */
    private String oldInvoiceCode;
    /**
     * 对应蓝票发票号码，红票时有值（蓝票为数电电票时返回原来的20位数电票号码，数电纸票时为8位的纸票号码）
     */
    private String oldInvoiceNo;
    /**
     * 红票对应的蓝票的全电发票号码（蓝票为全电发票（电票+纸票）时返回） </bre>
     * exg: 22312000000000183316
     */
    private String oldEleInvoiceNumber;
    /**
     * 清单标志:0,非清单;1,清单票
     */
    private String listFlag;
    /**
     * 清单项目名称:打印清单时对应发票票面项目名称，注意：税总要求清单项目名称为（详见销货清单）
     */
    private String listName;
    /**
     * 购方手机(开票成功会短信提醒购方)
     */
    private String phone;
    /**
     * 购方邮箱推送邮箱(开票成功会邮件提醒购方)
     */
    private String notifyEmail;
    /**
     * 是否机动车类专票 0-否 1-是
     */
    private String vehicleFlag;
    /**
     * 数据创建时间（回传其他信息时返回）
     */
    private String createTime;
    /**
     * 数据更新时间（回传其他信息时返回）
     */
    private String updateTime;
    /**
     * 发票状态更新时间（回传其他信息时返回；涉及状态：开票中、开票失败、开票成功签章中、开票成功签章失败、开票完成、发票作废中、发票已作废）
     */
    private String stateUpdateTime;
    /**
     * 代开标志 0-非代开  1-代开（回传其他信息时返回）
     */
    private String proxyInvoiceFlag;
    /**
     * 用于开票的订单的时间（回传其他信息时返回）
     */
    private Long invoiceDate;
    /**
     * 开票类型 1-蓝票  2-红票（回传其他信息时返回）
     */
    private String invoiceType;
    /**
     * 冲红原因 1:销货退回;2:开票有误;3:服务中止;4:发生销售折让（红票且票种为p、c、e、f、r（成品油发票除外）且回传其他信息时返回）
     */
    private String redReason;
    /**
     * 作废时间（已作废状态下的发票，且回传其他信息时返回）
     */
    private String invalidTime;
    /**
     * 作废来源 1-诺诺工作台 2-API接口 3-开票软件 4-验签失败作废  5-其他（已作废状态下的发票，且回传其他信息时返回）
     */
    private String invalidSource;
    /**
     * 数电纸票作废原因 1:销货退回;2:开票有误;3:服务中止;4:其他（已作废状态下的发票，且票为数电纸票且回传其他信息时返回）
     */
    private String invalidReason;
    /**
     * 其他作废原因详情（作废原因为4 且回传其他信息时返回）
     */
    private String specificReason;
    /**
     * 发票特定要素：（后续枚举值会有扩展，回传其他信息时返回）0-普通 1-成品油发票 31-建安发票 32-房地产销售发票 35-矿产品发票
     */
    private String specificFactor;
    /**
     * 邮箱交付状态（0-未交付，1-交付成功，2-交付失败，3-交付中，4-不会交付；注：回传其他信息时返回）
     */
    private String emailNotifyStatus;
    /**
     * <pre>
     * 手机交付状态：
     *  0-未交付
     *  1-交付成功
     *  2-交付失败
     *  3-交付中
     *  4-不会交付
     *  注：回传其他信息时返回
     * </pre>
     */
    private String phoneNotifyStatus;
    /**
     * 购买方经办人姓名（数电票特有字段）
     */
    private String buyerManagerName;
    /**
     * 经办人证件类型：101-组织机构代码证, 102-营业执照, 103-税务登记证, 199-其他单位证件, 201-居民身份证, 202-军官证, 203-武警警官证, 204-士兵证, 205-军队离退休干部证, 206-残疾人证, 207-残疾军人证（1-8级）, 208-外国护照, 210-港澳居民来往内地通行证
     */
    private String managerCardType;
    /**
     * 经办人证件号码（数电票特有字段）
     */
    private String managerCardNo;
    /**
     * 附加模版名称（数电票特有字段）
     */
    private String additionalElementName;
    /**
     * 全电发票号码（全电发票
     */
    private String allElectronicInvoiceNumber;

    /**
     * 机动车销售统一发票中机动车相关信息（只有机动车销售统一发票才会返回）
     */
    private Vehicle vehicleInfo;
    /**
     * 二手车销售统一发票时才有值返回
     */
    private SecondHandCar secondHandCarInfo;

    /**
     * 发票明细集合
     */
    private List<InvoiceItem> invoiceItems;
    /**
     * 附加要素信息列表（数电票特有字段，附加要素信息可以有多个）
     */
    private List<Additional> additionalElementList;

    public String getSerialNo() {
        return serialNo;
    }

    public void setSerialNo(String serialNo) {
        this.serialNo = serialNo;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getStatusMsg() {
        return statusMsg;
    }

    public void setStatusMsg(String statusMsg) {
        this.statusMsg = statusMsg;
    }

    public String getFailCause() {
        return failCause;
    }

    public void setFailCause(String failCause) {
        this.failCause = failCause;
    }

    public String getPdfUrl() {
        return pdfUrl;
    }

    public void setPdfUrl(String pdfUrl) {
        this.pdfUrl = pdfUrl;
    }

    public String getPictureUrl() {
        return pictureUrl;
    }

    public void setPictureUrl(String pictureUrl) {
        this.pictureUrl = pictureUrl;
    }

    public Long getInvoiceTime() {
        return invoiceTime;
    }

    public void setInvoiceTime(Long invoiceTime) {
        this.invoiceTime = invoiceTime;
    }

    public String getInvoiceCode() {
        return invoiceCode;
    }

    public void setInvoiceCode(String invoiceCode) {
        this.invoiceCode = invoiceCode;
    }

    public String getInvoiceNo() {
        return invoiceNo;
    }

    public void setInvoiceNo(String invoiceNo) {
        this.invoiceNo = invoiceNo;
    }

    public String getAllElectronicInvoiceNumbe() {
        return allElectronicInvoiceNumbe;
    }

    public void setAllElectronicInvoiceNumbe(String allElectronicInvoiceNumbe) {
        this.allElectronicInvoiceNumbe = allElectronicInvoiceNumbe;
    }

    public String getExTaxAmount() {
        return exTaxAmount;
    }

    public void setExTaxAmount(String exTaxAmount) {
        this.exTaxAmount = exTaxAmount;
    }

    public String getTaxAmount() {
        return taxAmount;
    }

    public void setTaxAmount(String taxAmount) {
        this.taxAmount = taxAmount;
    }

    public String getOrderAmount() {
        return orderAmount;
    }

    public void setOrderAmount(String orderAmount) {
        this.orderAmount = orderAmount;
    }

    public String getPayerName() {
        return payerName;
    }

    public void setPayerName(String payerName) {
        this.payerName = payerName;
    }

    public String getPayerTaxNo() {
        return payerTaxNo;
    }

    public void setPayerTaxNo(String payerTaxNo) {
        this.payerTaxNo = payerTaxNo;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public String getBankAccount() {
        return bankAccount;
    }

    public void setBankAccount(String bankAccount) {
        this.bankAccount = bankAccount;
    }

    public String getInvoiceKind() {
        return invoiceKind;
    }

    public void setInvoiceKind(String invoiceKind) {
        this.invoiceKind = invoiceKind;
    }

    public String getCheckCode() {
        return checkCode;
    }

    public void setCheckCode(String checkCode) {
        this.checkCode = checkCode;
    }

    public String getQrCode() {
        return qrCode;
    }

    public void setQrCode(String qrCode) {
        this.qrCode = qrCode;
    }

    public String getMachineCode() {
        return machineCode;
    }

    public void setMachineCode(String machineCode) {
        this.machineCode = machineCode;
    }

    public String getCipherText() {
        return cipherText;
    }

    public void setCipherText(String cipherText) {
        this.cipherText = cipherText;
    }

    public String getPaperPdfUrl() {
        return paperPdfUrl;
    }

    public void setPaperPdfUrl(String paperPdfUrl) {
        this.paperPdfUrl = paperPdfUrl;
    }

    public String getOfdUrl() {
        return ofdUrl;
    }

    public void setOfdUrl(String ofdUrl) {
        this.ofdUrl = ofdUrl;
    }

    public String getXmlUrl() {
        return xmlUrl;
    }

    public void setXmlUrl(String xmlUrl) {
        this.xmlUrl = xmlUrl;
    }

    public String getClerk() {
        return clerk;
    }

    public void setClerk(String clerk) {
        this.clerk = clerk;
    }

    public String getPayee() {
        return payee;
    }

    public void setPayee(String payee) {
        this.payee = payee;
    }

    public String getChecker() {
        return checker;
    }

    public void setChecker(String checker) {
        this.checker = checker;
    }

    public String getSalerAccount() {
        return salerAccount;
    }

    public void setSalerAccount(String salerAccount) {
        this.salerAccount = salerAccount;
    }

    public String getSalerTel() {
        return salerTel;
    }

    public void setSalerTel(String salerTel) {
        this.salerTel = salerTel;
    }

    public String getSalerAddress() {
        return salerAddress;
    }

    public void setSalerAddress(String salerAddress) {
        this.salerAddress = salerAddress;
    }

    public String getSalerTaxNum() {
        return salerTaxNum;
    }

    public void setSalerTaxNum(String salerTaxNum) {
        this.salerTaxNum = salerTaxNum;
    }

    public String getSalerName() {
        return salerName;
    }

    public void setSalerName(String salerName) {
        this.salerName = salerName;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getProductOilFlag() {
        return productOilFlag;
    }

    public void setProductOilFlag(String productOilFlag) {
        this.productOilFlag = productOilFlag;
    }

    public String getImgUrls() {
        return imgUrls;
    }

    public void setImgUrls(String imgUrls) {
        this.imgUrls = imgUrls;
    }

    public String getExtensionNumber() {
        return extensionNumber;
    }

    public void setExtensionNumber(String extensionNumber) {
        this.extensionNumber = extensionNumber;
    }

    public String getTerminalNumber() {
        return terminalNumber;
    }

    public void setTerminalNumber(String terminalNumber) {
        this.terminalNumber = terminalNumber;
    }

    public String getDeptId() {
        return deptId;
    }

    public void setDeptId(String deptId) {
        this.deptId = deptId;
    }

    public String getClerkId() {
        return clerkId;
    }

    public void setClerkId(String clerkId) {
        this.clerkId = clerkId;
    }

    public String getOldInvoiceCode() {
        return oldInvoiceCode;
    }

    public void setOldInvoiceCode(String oldInvoiceCode) {
        this.oldInvoiceCode = oldInvoiceCode;
    }

    public String getOldInvoiceNo() {
        return oldInvoiceNo;
    }

    public void setOldInvoiceNo(String oldInvoiceNo) {
        this.oldInvoiceNo = oldInvoiceNo;
    }

    public String getOldEleInvoiceNumber() {
        return oldEleInvoiceNumber;
    }

    public void setOldEleInvoiceNumber(String oldEleInvoiceNumber) {
        this.oldEleInvoiceNumber = oldEleInvoiceNumber;
    }

    public String getListFlag() {
        return listFlag;
    }

    public void setListFlag(String listFlag) {
        this.listFlag = listFlag;
    }

    public String getListName() {
        return listName;
    }

    public void setListName(String listName) {
        this.listName = listName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getNotifyEmail() {
        return notifyEmail;
    }

    public void setNotifyEmail(String notifyEmail) {
        this.notifyEmail = notifyEmail;
    }

    public String getVehicleFlag() {
        return vehicleFlag;
    }

    public void setVehicleFlag(String vehicleFlag) {
        this.vehicleFlag = vehicleFlag;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getStateUpdateTime() {
        return stateUpdateTime;
    }

    public void setStateUpdateTime(String stateUpdateTime) {
        this.stateUpdateTime = stateUpdateTime;
    }

    public String getProxyInvoiceFlag() {
        return proxyInvoiceFlag;
    }

    public void setProxyInvoiceFlag(String proxyInvoiceFlag) {
        this.proxyInvoiceFlag = proxyInvoiceFlag;
    }

    public Long getInvoiceDate() {
        return invoiceDate;
    }

    public void setInvoiceDate(Long invoiceDate) {
        this.invoiceDate = invoiceDate;
    }

    public String getInvoiceType() {
        return invoiceType;
    }

    public void setInvoiceType(String invoiceType) {
        this.invoiceType = invoiceType;
    }

    public String getRedReason() {
        return redReason;
    }

    public void setRedReason(String redReason) {
        this.redReason = redReason;
    }

    public String getInvalidTime() {
        return invalidTime;
    }

    public void setInvalidTime(String invalidTime) {
        this.invalidTime = invalidTime;
    }

    public String getInvalidSource() {
        return invalidSource;
    }

    public void setInvalidSource(String invalidSource) {
        this.invalidSource = invalidSource;
    }

    public String getInvalidReason() {
        return invalidReason;
    }

    public void setInvalidReason(String invalidReason) {
        this.invalidReason = invalidReason;
    }

    public String getSpecificReason() {
        return specificReason;
    }

    public void setSpecificReason(String specificReason) {
        this.specificReason = specificReason;
    }

    public String getSpecificFactor() {
        return specificFactor;
    }

    public void setSpecificFactor(String specificFactor) {
        this.specificFactor = specificFactor;
    }

    public String getEmailNotifyStatus() {
        return emailNotifyStatus;
    }

    public void setEmailNotifyStatus(String emailNotifyStatus) {
        this.emailNotifyStatus = emailNotifyStatus;
    }

    public String getPhoneNotifyStatus() {
        return phoneNotifyStatus;
    }

    public void setPhoneNotifyStatus(String phoneNotifyStatus) {
        this.phoneNotifyStatus = phoneNotifyStatus;
    }

    public String getBuyerManagerName() {
        return buyerManagerName;
    }

    public void setBuyerManagerName(String buyerManagerName) {
        this.buyerManagerName = buyerManagerName;
    }

    public String getManagerCardType() {
        return managerCardType;
    }

    public void setManagerCardType(String managerCardType) {
        this.managerCardType = managerCardType;
    }

    public String getManagerCardNo() {
        return managerCardNo;
    }

    public void setManagerCardNo(String managerCardNo) {
        this.managerCardNo = managerCardNo;
    }

    public String getAdditionalElementName() {
        return additionalElementName;
    }

    public void setAdditionalElementName(String additionalElementName) {
        this.additionalElementName = additionalElementName;
    }

    public String getAllElectronicInvoiceNumber() {
        return allElectronicInvoiceNumber;
    }

    public void setAllElectronicInvoiceNumber(String allElectronicInvoiceNumber) {
        this.allElectronicInvoiceNumber = allElectronicInvoiceNumber;
    }

    public Vehicle getVehicleInfo() {
        return vehicleInfo;
    }

    public void setVehicleInfo(Vehicle vehicleInfo) {
        this.vehicleInfo = vehicleInfo;
    }

    public SecondHandCar getSecondHandCarInfo() {
        return secondHandCarInfo;
    }

    public void setSecondHandCarInfo(SecondHandCar secondHandCarInfo) {
        this.secondHandCarInfo = secondHandCarInfo;
    }

    public List<InvoiceItem> getInvoiceItems() {
        return invoiceItems;
    }

    public void setInvoiceItems(List<InvoiceItem> invoiceItems) {
        this.invoiceItems = invoiceItems;
    }

    public List<Additional> getAdditionalElementList() {
        return additionalElementList;
    }

    public void setAdditionalElementList(List<Additional> additionalElementList) {
        this.additionalElementList = additionalElementList;
    }

    @JsonIgnore
    public InvoiceConstant.InvoiceStatus getInvoiceStatus() {
        return InvoiceConstant.apiInvoiceStatusParse(status);
    }
}
